#ifndef _TASK_H_
#define _TASK_H_

#include "AIP1629.h"
#include "clsPCA9555.h"

// 通讯协议定义
#define CMD_AIP1629_ADDRMODE        0x40
#define CMD_AIP1629_ADDFIXED        0x44
#define CMD_AIP1629_STARTADDR(addr) addr|0xC0
// LED And TUBE
#define ON  0x88
#define OFF 0x80
#define FIRST_LEVEL   0x88
#define SECOND_LEVEL  0x8B
#define THREE_LEVEL   0x8F
#define CLS_LED           	0x01
#define CLS_TUBE          	0x02
#define CLS_LED_AND_TUBE  	0x03

#define MENU_NULL			0x00
#define MENU_SELECT			0x55
#define MENU_READ			0x01
#define MENU_WRITE			0x02
#define MENU_VOLTAGE		0x03

extern uint8_t displaydata[3];
extern uint8_t LedAddr[4];		
extern uint8_t TubeAddr[3];		
extern uint8_t PortTube[24];	

union Data_union
{
    byte byte_c[4];
    uint32_t ut32bit;
    float floatVal;
};
byte reverseBinary(byte b);

void ClsLedOrTube(byte type);
  void ShowSingleLed(uint8_t id, uint8_t type);
void ShowMultiLed(uint32_t id);

#endif
